package com.repository;

import com.domain.User;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface UserRepository extends JpaRepository<User, Integer> {
    @Transactional
    @Modifying
    @Query("UPDATE t_user AS c SET c.pwd = :pwd WHERE c.id = :id")
    int updateUser(@Param("id") Integer id, @Param("pwd") String pwd);    //根据id修改用户信息
}
